home *** CD-ROM | disk | FTP | other *** search
/ Risc World 3 / Risc World 3.iso / SOFTWARE / ISSUE6 / PD / PDF / GuiLib / Task / h / GuiToolbox < prev    next >
Text File  |  2003-02-14  |  4KB  |  117 lines

  1. //--------------------------------------------------------------------------
  2. //
  3. //   Copyright (c) 2002, Colin Granville
  4. //
  5. //   All rights reserved.
  6. //
  7. //   Redistribution and use in source and binary forms, with or
  8. //   without modification, are permitted provided that the following 
  9. //   conditions are met:
  10. //
  11. //      * Redistributions of source code must retain the above copyright 
  12. //        notice, this list of conditions and the following disclaimer.
  13. //
  14. //      * Redistributions in binary form must reproduce the above 
  15. //        copyright notice, this list of conditions and the following 
  16. //        disclaimer in the documentation and/or other materials 
  17. //        provided with the distribution.
  18. //
  19. //      * The name Colin Granville may not be used to endorse or promote 
  20. //        products derived from this software without specific prior 
  21. //        written permission.
  22. //
  23. //   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
  24. //   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
  25. //   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
  26. //   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
  27. //   COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
  28. //   INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
  29. //   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
  30. //   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
  31. //   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
  32. //   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
  33. //   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
  34. //   OF THE POSSIBILITY OF SUCH DAMAGE.
  35. //
  36. //--------------------------------------------------------------------------
  37.  
  38. #ifndef GuiToolbox_h
  39. #define GuiToolbox_h
  40.  
  41. class GuiMessagesFD
  42. {
  43.   public:
  44.     int           data [4];
  45. };                         
  46.  
  47. struct GuiToolboxEventHeader
  48. {
  49.   unsigned int     size;
  50.   int              referenceNumber;
  51.   unsigned int     eventCode;
  52.   unsigned int     flags;
  53. };
  54.  
  55. struct GuiToolboxEvent : public GuiToolboxEventHeader
  56. {
  57.   union
  58.   {
  59.     char          bytes [236-sizeof(GuiToolboxEventHeader)];
  60.     int           words [(236-sizeof(GuiToolboxEventHeader))/sizeof(int)];
  61.   } data;
  62. };   
  63.  
  64. typedef int GuiObjectId;            // abstract Object Id (as used by client apps)
  65. typedef int GuiComponentId;         // component Id within an Object (eg gadget in Window)
  66.  
  67. #define NULL_GuiObjectId    (GuiObjectId)0
  68. #define NULL_GuiComponentId (GuiComponentId)-1
  69.  
  70. class GuiIdBlock               
  71. {
  72.   public:
  73.     struct
  74.     {
  75.       GuiObjectId      id;
  76.       GuiComponentId   component;
  77.     } ancestor,
  78.       parent,
  79.       self;
  80. };
  81.  
  82.  
  83. #define GuiToolbox_SWIChunkBase            0x44ec0
  84.  
  85. #ifndef Toolbox_CreateObject
  86. #define Toolbox_CreateObject            (GuiToolbox_SWIChunkBase + 0)
  87. #define Toolbox_DeleteObject            (GuiToolbox_SWIChunkBase + 1)
  88. #define Toolbox_ShowObject              (GuiToolbox_SWIChunkBase + 3)
  89. #define Toolbox_HideObject              (GuiToolbox_SWIChunkBase + 4)
  90. #define Toolbox_GetObjectState          (GuiToolbox_SWIChunkBase + 5)
  91. #define Toolbox_ObjectMiscOp            (GuiToolbox_SWIChunkBase + 6)
  92. #define Toolbox_RaiseToolboxEvent       (GuiToolbox_SWIChunkBase + 13)
  93. #define Toolbox_GetSysInfo              (GuiToolbox_SWIChunkBase + 14)
  94. #define Toolbox_Initialise              (GuiToolbox_SWIChunkBase + 15)
  95. #endif
  96.  
  97. //****************************************************************************
  98. // Toolbox Events                                                            
  99. // ***************************************************************************
  100.  
  101.  
  102. struct GuiToolbox
  103. {
  104.   struct Error : public GuiToolboxEventHeader
  105.   {
  106.     enum {Event = GuiToolbox_SWIChunkBase + 0};
  107.     int                   errnum;
  108.     char                  errmess [sizeof(GuiToolboxEvent)-sizeof(GuiToolboxEventHeader)-
  109.                                        sizeof(GuiObjectId)-
  110.                                        sizeof(GuiComponentId)-
  111.                                        sizeof(int)];
  112.   };
  113.  
  114. };
  115.  
  116. #endif
  117.